Skip to content

Change sync to cp - #169

Merged
wagnerlmichael merged 1 commit into
mainfrom
mwagner/swap-sync-with-cp
Oct 5, 2026
Merged

wagnerlmichael merged 1 commit into
mainfrom
mwagner/swap-sync-with-cp

Conversation

@wagnerlmichael

@wagnerlmichael wagnerlmichael commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

fi

aws s3 sync "${LOCAL}/" "${REMOTE}/" --no-progress
aws s3 cp "${LOCAL}/" "${REMOTE}/" --recursive --no-progress

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With sync, the idea is to only upload what has changed, so it lists every object in the relevant s3 dir, then makes the comparison. I suspect this is why the upload takes so long.

cp just copies the file, and overwrites it if there is an existing file, which is orders of magnitude faster.

--recursive docs: --recursive (boolean) Command is performed on all files or objects under the specified directory or prefix.

I don't think that we need what sync provides, but maybe I'm missing something!

@wagnerlmichael
wagnerlmichael marked this pull request as ready for review October 2, 2026 18:54

@jeancochrane jeancochrane left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm down for this change! This thread and its subsequent replies contain some interesting discussion of cases in which sync is a better choice than cp, namely when there are lots of unchanged files in the source and you want to reduce your spend by avoiding pushing them to the destination. However, we tend to expect to overwrite all files when we do deploys these days, so I think the speed and simplicity of cp makes sense for our use case.

@wagnerlmichael
wagnerlmichael merged commit 6e0a550 into main Oct 5, 2026
4 checks passed
@wagnerlmichael
wagnerlmichael deleted the mwagner/swap-sync-with-cp branch October 5, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate slow S3 upload speeds in generate-pinval workflow

2 participants